package com.dustedpixels.jasmin.audio;

import java.nio.ByteBuffer;

public interface AudioContext {
    /**
     * Sets the number of audio channels. Currently only 1 and 2 are supported.
     * Default is 1.
     * 
     * @param channels The number of channels.
     */
    void setNumberOfChannels(int channels);

    /**
     * Sets the resolution of the sample bits. Currently, only 8 and 16 are
     * supported. Default is 8.
     * 
     * @param sampleBits The number of sample bits.
     */
    void setSampleBits(int sampleBits);

    /**
     * Renders audio samples from specified buffer.
     * 
     * @param buffer The buffer with audio samples.
     */
    void render(ByteBuffer buffer);

    /**
     * Returns true, if audio is currently muted. The Audio unit is free to make
     * optimisations (in example it can temporarily suspend the rendering).
     * 
     * @return True is audio is muted.
     */
    boolean isMuted();
}
